﻿<%@ Page Language="C#" MasterPageFile="~/admin/MasterPage_Admin.master" AutoEventWireup="true"
    CodeFile="ads_manage.aspx.cs" Inherits="admin_ads_manage" Title="IT110：不良信息举报与检索平台 - 广告信息管理 - By ECountry.Ltd" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_Search" runat="Server">
    <div class="w-sjzzbb">
        <div class="w-sjzztop">
            广告管理中心
        </div>
    </div>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <div style="border:1px solid #09f;text-align:left"><p style="font-size:17px;text-align:center">综合广告信息管理中心</p>
            请选择广告位置类型：
            <asp:DropDownList ID="DropDownList_type" runat="server" AppendDataBoundItems="True"
                AutoPostBack="True" DataSourceID="ObjectDataSource_Ads_Type" DataTextField="position"
                DataValueField="id">
                <asp:ListItem Selected="True" Value="0">==全部==</asp:ListItem>
            </asp:DropDownList>
            <asp:ObjectDataSource ID="ObjectDataSource_Ads_Type" runat="server" OldValuesParameterFormatString="original_{0}"
                SelectMethod="Get_Data_Order_By_Id" TypeName="DataSet_fp_ads_DyhTableAdapters.Dyh_ADS_positionTableAdapter">
            </asp:ObjectDataSource>
            </div>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                DataSourceID="ObjectDataSource_Ads_Manage" Width="100%" Style="font-size: 12px;
                text-align: center" AlternatingRowStyle-BackColor="#f5f5f5" BorderStyle="Solid" BorderColor="#ffffff"
                OnRowDataBound="GridView1_RowDataBound" DataKeyNames="id" AllowSorting="True"
                PageSize="16" Font-Size="6pt">
                <HeaderStyle BackColor="#0099ff" ForeColor="White" Height="40" Font-Size="15px" HorizontalAlign="Center" VerticalAlign="Middle"/>
                <RowStyle BackColor="#c7e9ff" ForeColor="#333333" Height="40"/>
                <PagerSettings PageButtonCount="13" />
                <Columns>
                    <asp:BoundField DataField="id" HeaderText="ID" SortExpression="id" ReadOnly="True"
                        InsertVisible="False">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="position" HeaderText="广告位置" SortExpression="title">
                        <ItemStyle HorizontalAlign="Left" Width="140px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="宽×高(px)" SortExpression="hits">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("width")+"×"+Eval("height") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="type" HeaderText="类型" SortExpression="subclasstitle">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="收费标准" SortExpression="truename" DataField="cost" DataFormatString="{0}元/月">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle Width="70px" HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="jointime" HeaderText="修改时间" SortExpression="jointime"
                        DataFormatString="{0:d}">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="75px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Isopen" HeaderText="开放" SortExpression="Isopen">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Issale" HeaderText="已租" SortExpression="Issale">
                        <ItemStyle HorizontalAlign="Center" Width="30px" />
                    </asp:BoundField>
                    <asp:HyperLinkField DataNavigateUrlFields="id" DataNavigateUrlFormatString="ads_modi.aspx?adsid={0}"
                        HeaderText="编辑" Text="修改">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle Width="40px" HorizontalAlign="Center" ForeColor="Blue" />
                    </asp:HyperLinkField>
                    <asp:TemplateField HeaderText="删除" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                OnClientClick="javascript:return confirm('您确定要删除该记录吗? 您将无法恢复！');" Text="删除"></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="40px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="Issale" HeaderText="禁用" SortExpression="isshow" Visible="False">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                    </asp:BoundField>
                </Columns>
                <AlternatingRowStyle BackColor="White" />
                <PagerTemplate>
                    <table width="100%">
                        <tr>
                            <td style="text-align: center">
                                第<asp:Label ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />
                                页 共<asp:Label ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' />
                                页
                                <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                    CommandArgument="First" CommandName="Page" Text="首页" />
                                <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                    CommandArgument="Prev" CommandName="Page" Text="上一页" />
                                <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                    CommandArgument="Next" CommandName="Page" Text="下一页" />
                                <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                    CommandArgument="Last" CommandName="Page" Text="尾页" />
                                <%--                            第<asp:textbox id="txtNewPageIndex" runat="server" width="20px" text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />页
                            <asp:linkbutton  id="btnGo" runat="server" causesvalidation="False" commandargument="-1" commandname="Page" text="GO" OnClick="btnGo_Click" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
                                --%>
                            </td>
                        </tr>
                    </table>
                </PagerTemplate>
                <PagerStyle BackColor="#0099ff" ForeColor="#ffffff" HorizontalAlign="Left" Height="40" />
                <EmptyDataTemplate>
                    <div class="style61">
                        <br />
                        <br />
                        <br />
                        <span class="style60">暂无数据 ！<br />
                        </span>
                        <br />
                        <br />
                    </div>
                </EmptyDataTemplate>
                <SelectedRowStyle BackColor="#E0E0E0" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="ObjectDataSource_Ads_Manage" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="Get_Union_Data_By_PositionId_OrderBy_Time_For_Admin" TypeName="DataSet_fp_ads_DyhTableAdapters.Dyh_ADTableAdapter"
        DeleteMethod="Delete">
        <DeleteParameters>
            <asp:Parameter Name="Original_id" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList_type" Name="positionid" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
